<template>
  <div style="width:80%;margin:0 auto;padding-bottom: 50px;">
    <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px"
      label-position="top">
      <el-form-item label="手机号" prop="mobile">
        <el-input v-model="formData.mobile" placeholder="请输入手机号" :maxlength="11" show-word-limit clearable
          prefix-icon='el-icon-mobile' :style="{width: '100%'}"></el-input>
      </el-form-item>
      <el-form-item label="今日工作内容" prop="field101">
        <el-input v-model="formData.field101" type="textarea" placeholder="请输入今日工作内容"
          :autosize="{minRows: 4, maxRows: 4}" :style="{width: '100%'}"></el-input>
      </el-form-item>
      <el-form-item label="今日负责人" prop="field102">
        <el-input v-model="formData.field102" placeholder="请输入今日负责人" clearable :style="{width: '100%'}">
        </el-input>
      </el-form-item>
      <el-form-item label="今日配合人" prop="field103">
        <el-input v-model="formData.field103" placeholder="请输入今日配合人" clearable :style="{width: '100%'}">
        </el-input>
      </el-form-item>
      <el-form-item label="今日完成时间" prop="field105">
        <el-date-picker type="datetime" v-model="formData.field105" format="yyyy-MM-dd HH:mm:ss"
          value-format="yyyy-MM-dd HH:mm:ss" :style="{width: '100%'}" placeholder="请选择今日完成时间" clearable>
        </el-date-picker>
      </el-form-item>
      <el-form-item label="今日遇到问题" prop="field106">
        <el-input v-model="formData.field106" type="textarea" placeholder="请输入今日遇到问题"
          :autosize="{minRows: 4, maxRows: 4}" :style="{width: '100%'}"></el-input>
      </el-form-item>
      <el-form-item label="明日计划" prop="field107">
        <el-input v-model="formData.field107" type="textarea" placeholder="请输入明日计划"
          :autosize="{minRows: 4, maxRows: 4}" :style="{width: '100%'}"></el-input>
      </el-form-item>
      <el-form-item size="large">
        <el-button type="primary" @click="submitForm">提交</el-button>
        <el-button @click="resetForm">重置</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>
<script>
export default {
  name:'Popup',
  components: {},
  props: [],
  data() {
    return {
      formData: {
        mobile: '',
        field101: '',
        field102: undefined,
        field103: undefined,
        field105: '2020-04-29 14:26:00',
        field106: undefined,
        field107: undefined,
      },
      rules: {
        mobile: [{
          required: true,
          message: '请输入手机号',
          trigger: 'blur'
        }, {
          pattern: /^1(3|4|5|7|8|9)\d{9}$/,
          message: '手机号格式错误',
          trigger: 'blur'
        }],
        field101: [{
          required: true,
          message: '请输入今日工作内容',
          trigger: 'blur'
        }],
        field102: [{
          required: true,
          message: '请输入今日负责人',
          trigger: 'blur'
        }],
        field103: [{
          required: true,
          message: '请输入今日配合人',
          trigger: 'blur'
        }],
        field105: [{
          required: true,
          message: '请选择今日完成时间',
          trigger: 'change'
        }],
        field106: [{
          required: true,
          message: '请输入今日遇到问题',
          trigger: 'blur'
        }],
        field107: [{
          required: true,
          message: '请输入明日计划',
          trigger: 'blur'
        }],
      },
    }
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {},
  methods: {
    submitForm() {
      this.$refs['elForm'].validate(valid => {
        if (!valid) return
        // TODO 提交表单
      })
    },
    resetForm() {
      this.$refs['elForm'].resetFields()
    },
  }
}

</script>
<style>


</style>
